//
//  MyPointCtrl.m
//  spotrs
//
//  Created by sky on 16/5/17.
//  Copyright © 2016年 TZ. All rights reserved.
//

#import "MyPointCtrl.h"
#import "PointRecordCtrl.h"
@interface MyPointCtrl ()
@end

@implementation MyPointCtrl

- (void)viewDidLoad {
    [super viewDidLoad];
    [self buildLayout];
    // Do any additional setup after loading the view.
}

-(void)buildLayout{
    self.view.backgroundColor = [LCCommon getColor:@"f6f7f8"];
    self.titleText = @"我的积分";
    [self creatTopNavagaiong];
    [self liftGoBackImage];
    
    
    
    UIView *firstbgvi = [[UIView alloc]initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, 45)];
    firstbgvi.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:firstbgvi];
    UILabel *pointrec = [self LabelWithRect:CGRectMake(15, 45/2 - 15/2, 100, 15) textColor:[LCCommon getColor:@"000000"] textstr:@"积分记录" textfont:15 textstyle:NSTextAlignmentLeft];
    [firstbgvi addSubview:pointrec];
    [self makeLinewithRect:CGRectMake(0, 44.5, SCREEN_WIDTH, .5) Color:[LCCommon getColor:@"999999"] addview:firstbgvi];
    UIImage *xx = [[UIImage alloc]init];
    UIImageView *jiantou = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 15 - 15, 45/2 - 15/2, 15, 15)];
    jiantou.backgroundColor = [LCCommon getColor:@"787878"];
    [firstbgvi addSubview:jiantou];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(firstClick)];
    [firstbgvi addGestureRecognizer:tap];
    
    UIView *secbgvi = [[UIView alloc]initWithFrame:CGRectMake(0, 64 + 45, SCREEN_WIDTH, 45)];
    secbgvi.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:secbgvi];
    UILabel *pointshuoming = [self LabelWithRect:CGRectMake(15, 45/2 - 15/2, 100, 15) textColor:[LCCommon getColor:@"000000"] textstr:@"积分说明" textfont:15 textstyle:NSTextAlignmentLeft];
    [secbgvi addSubview:pointshuoming];
    [self makeLinewithRect:CGRectMake(0, 44.5, SCREEN_WIDTH, .5) Color:[LCCommon getColor:@"999999"] addview:secbgvi];
    UIImage *xxx = [[UIImage alloc]init];
    UIImageView *jiantou1 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 15 - 15, 45/2 - 15/2, 15, 15)];
    jiantou1.backgroundColor = [LCCommon getColor:@"787878"];
    [secbgvi addSubview:jiantou1];
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(secClick)];
    [secbgvi addGestureRecognizer:tap1];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)firstClick{
    NSLog(@"123321");
    PointRecordCtrl *point = [[PointRecordCtrl alloc]init];
    [self.navigationController pushViewController:point animated:YES];
}

-(void)secClick{
    NSLog(@"111111");
}

-(UILabel *)LabelWithRect:(CGRect)rect textColor:(UIColor *)color textstr:(NSString *)str textfont:(int)font textstyle:(NSTextAlignment)aligment{
    UILabel *label = [[UILabel alloc] initWithFrame:rect];
    label.textColor = color;
    label.text = str;
    label.font = [UIFont systemFontOfSize:font];
    label.textAlignment = aligment;
    label.numberOfLines = 0;
    return label;
}

-(void)makeLinewithRect:(CGRect)rect Color:(UIColor *)color addview:(UIView *)vi{
    UIView *line = [[UIView alloc]initWithFrame:rect];
    line.backgroundColor = color;
    [vi addSubview:line];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
